﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace ueEngine.Biz.Inf.Entities.DBSupport
{
    public class Context : DbContext
    {
        public static string CONNECTION_STRING = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectStr"].ToString();

        #region DbContext
        /// <summary>
        /// 商家（一个企业会员只能维护一个商家信息）
        /// </summary>
        public DbSet<Corporation> Corporation { get; set; }

        /// <summary>
        /// 招募企业（一个企业会员可以维护N个招募企业）
        /// </summary>
        public DbSet<DepositCompany> DepositCompany { get; set; }

        /// <summary>
        /// 用户
        /// </summary>
        public DbSet<Member> Member { get; set; }

        /// <summary>
        /// 职位信息
        /// </summary>
        public DbSet<Position> Position { get; set; }

        /// <summary>
        /// 简历
        /// </summary>
        public DbSet<ResumeSheet> ResumeSheet { get; set; }

        /// <summary>
        /// 招募单
        /// </summary>
        public DbSet<RecruitSheet> RecruitSheet { get; set; }

        /// <summary>
        /// 职位申请单
        /// </summary>
        public DbSet<RequestSheet> RequestSheet { get; set; }

        /// <summary>
        /// 代理申请
        /// </summary>
        public DbSet<Trusteeship> Trusteeship { get; set; }

        /// <summary>
        /// 公告
        /// </summary>
        public DbSet<SystemNotice> SystemNotice { get; set; }

        /// <summary>
        /// 广告
        /// </summary>
        public DbSet<SystemAdvert> SystemAdvert { get; set; }

        /// <summary>
        /// 管理员
        /// </summary>
        public DbSet<SystemUser> SystemUser { get; set; }

        /// <summary>
        /// 活动现场
        /// </summary>
        public DbSet<Activity> Activity { get; set; }

        /// <summary>
        /// 微评论
        /// </summary>
        public DbSet<ShortDiscuss> ShortDiscuss { get; set; }

        /// <summary>
        /// 人才库
        /// </summary>
        public DbSet<Talent> Talent { get; set; }

        /// <summary>
        /// 关注企业
        /// </summary>
        public DbSet<RecruiterCollect> RecruiterCollect { get; set; }

        /// <summary>
        /// 关注（职位、代理人）
        /// </summary>
        public DbSet<Attention> Attention { get; set; }

        /// <summary>
        /// 反馈
        /// </summary>
        public DbSet<Feedback> Feedback { get; set; }

        /// <summary>
        /// 活动申请表
        /// </summary>
        public DbSet<ApplicationForm> ApplicationForm { get; set; }
        #endregion

        public Context()
            : base(CONNECTION_STRING)
        { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}
